package com.chagee.channel.server.event.service;

import com.alibaba.fastjson.JSONObject;
import com.chagee.channel.api.bo.lark.*;

import java.util.List;
import javax.servlet.http.HttpServletRequest;

/**
 * @author: chang.jiawei
 * @date: 2024/01/18
 */
public interface LarkService {

    FileUploadResultBO upload2Lark(UploadFileBO uploadFile);

    String startApprove(StartApprovalBO startApprovalBO);

    void subscribeApproval(String code);

    void unsubscribeApproval(String code);

    boolean checkSignature(JSONObject body, HttpServletRequest request);

    JSONObject decrypt(String encrypt);

    JSONObject handleCallback(JSONObject param);

    void subscribeAllApproval();

    ApprovalInstanceDetailBO approvalInstanceDetail(String instanceCode);

    void revokeApprove(RevokeApprovalBO revokeApprovalBO);

    void approveApprove(ApproveApprovalBO approveApprovalBO);

    List<ApprovalPreviewNodeBO> approvalInstancePreview(PreviewApprovalBO previewApprovalBO);

    ApprovalDetailBO approvalDetail(String approvalCode);

    void rejectApprove(RejectApprovalBO rejectApprovalBO);

    ApprovalCommentListResponse approvalCommentsList(ApprovalCommentListRequest request);

    /**
     * 根据文件url上传文件至飞书
     * @param uploadFile
     * @return
     */
    FileUploadResultBO uploadFileByUrl(UploadFileUrlBO uploadFile);

    ApprovalCarbonCopyResponse approvalCarbonCopy(ApprovalCarbonCopyRequest request);

	/**
	 * 审批实例详情-全文评论
	 *
	 * @param instanceCode
	 * @param userId
	 * @return
	 */
	ApprovalCommentsBO approvalInstanceComment(String instanceCode, String userId);
}
